<template>
	<view class="user-lists">
		<view class="empty-msg" v-if="lists.length<=0">
			<view class="icon">
				<view class="iconfont icon-konghezi"></view>
			</view>
			<view class="info">暂无推广</view>
		</view>
		<block v-for="(val,index) in lists" :key="index">
			<view class="user bg-box">
				<view class="user-avatar">
					<image src="../../static/avatar/nologinavatar.png" mode="widthFix"></image>
				</view>
				<view class="user-content">
					<view class="row">
						<view class="label">用户编号</view>
						<view class="content">{{val.uid}}</view>
					</view>
					<view class="row">
						<view class="label">地址</view>
						<view class="content">{{val.address}}</view>
					</view>
				</view>
			</view>
		</block>

	</view>
</template>

<script>
	import api from "@/utils/api/invite/index.js"
	export default {
		data() {
			return {
				uids: "",
				lists: [],
			}
		},
		onLoad(e) {
			uni.setNavigationBarTitle({
				title: "LEVEL-" + e.type + "用户列表"
			})
			this.uids = e.uids;
			this.getUsers();
		},
		methods: {
			async getUsers() {
				let post = {
					uids: this.uids
				}
				let res = await api.userListByUids(post);
				if (res.status == 1) {
					this.lists = res.data;
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		height: 100%;
	}

	view {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
	}

	.user-lists {
		.user {
			flex-direction: row;
			padding: 15px;
			margin-bottom: 2px;

			.user-avatar {
				width: 200upx;
				justify-content: center;

				image {
					width: 64px;
					height: 64px;
				}
			}

			.user-content {
				width: 550upx;
				padding-left: 15px;

				.row {
					.label {
						opacity: .5;
						font-size: 12px;
					}

					.content {
						font-size: 14px;
						font-weight: bold;
					}
				}
			}
		}
	}
</style>
